package com.xin.data.simbapesa.dialog;

import android.content.Context;
import android.text.Html;
import android.view.LayoutInflater;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.xin.data.simbapesa.R;
import com.xin.data.simbapesa.base.BaseDialog;
import com.xin.data.simbapesa.databinding.SimbaBindcardBinding;
import com.xin.data.simbapesa.utils.ResUtils;
import com.xin.data.simbapesa.utils.ViewUtils;

public class BindCardDialog extends BaseDialog<SimbaBindcardBinding> {
    public BindCardDialog(@NonNull Context context) {
        super(context);
    }

    public BindCardDialog(@NonNull Context context, int themeResId) {
        super(context, themeResId);
    }

    protected BindCardDialog(@NonNull Context context, boolean cancelable, @Nullable OnCancelListener cancelListener) {
        super(context, cancelable, cancelListener);
    }

    @Override
    protected SimbaBindcardBinding initViewBinding(LayoutInflater inflater) {
        return SimbaBindcardBinding.inflate(inflater);
    }

    @Override
    protected void initView() {
        binding.tvTitle.setText(Html.fromHtml(ResUtils.s(R.string.bindcard_title)));

        binding.tvColse.setOnClickListener(v -> {
            ViewUtils.viewScale(v);
            dismiss();
            if (onBtnClickListener != null) {
                onBtnClickListener.btnOnClickColse();
            }
        });
        binding.tvOk.setOnClickListener(v -> {
            ViewUtils.viewScale(v);
            dismiss();
            if (onBtnClickListener != null) {
                onBtnClickListener.btnOnClickOk();
            }
        });

    }
}
